package com.tencent.sr.iris.basic.saas.service.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.tencent.sr.iris.activity.interfaces.response.group.GroupTaskBoardSecondResponse;
import com.tencent.sr.iris.basic.saas.common.enums.IrisOrderStatusEnum;
import com.tencent.sr.iris.basic.saas.common.enums.IrisTaskProfitStatusEnum;
import com.tencent.sr.iris.basic.saas.common.utils.CommonUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@ApiModel(value = "团长任务列表-多目标冲刺赛导出信息")
@Slf4j
@ColumnWidth(15)
public class GroupTaskBoardSaleNumSprintExportInfo extends GroupTaskBoardSprintBaseExportInfo {

    @ExcelProperty(value = "订单金额", index = 8)
    private String thirdPartOrderPrice;

    @ExcelProperty(value = "订单佣金", index = 9)
    private Double commissionBillCommissionFee;

    /**
     * CREATED：待付款、DELIVER_PENDING：待发货、SENT：待收货、SUCCESS：交易完成、CANCEL：已取消
     */
    @ExcelProperty(value = "订单状态", index = 10)
    private String orderStatus;


    /**
     * ("0","待分佣"),("1","分佣成功"),("2","分佣取消"),("3","分佣失败")
     */
    @ExcelProperty(value = "收益状态", index = 11)
    private String commissionStatus;

    public void readFromSearchResponseData(GroupTaskBoardSecondResponse response) {
        super.readFromSearchResponseData(response);
        this.setThirdPartOrderPrice(CommonUtils.longToDouble(response.getThirdPartOrderPrice()).toString());
        this.setCommissionBillCommissionFee(CommonUtils.longToDouble(response.getCommissionBillCommissionFee()));
        this.setOrderStatus(IrisOrderStatusEnum.getByStatus(response.getOrderStatus()));
        this.setCommissionStatus(IrisTaskProfitStatusEnum.getByStatus(response.getCommissionStatus()));
    }
}
